<div class="wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <div class="row">
                        <!-- 用户信息 -->
                        <div class="col-md-6">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h4 class="panel-title">用户信息</h4>
                                </div>
                                <div class="panel-body">
                                    <table class="table table-bordered">
                                        <tr>
                                            <td width="30%"><strong>用户昵称</strong></td>
                                            <td>{$info.nickname|default='未设置'}</td>
                                        </tr>
                                        <tr>
                                            <td><strong>手机号</strong></td>
                                            <td>{$info.mobile|default='未设置'}</td>
                                        </tr>
                                        <tr>
                                            <td><strong>用户头像</strong></td>
                                            <td>
                                                {if condition="!empty($info.avatar)"}
                                                    <img src="{$info.avatar}" alt="头像" style="width: 50px; height: 50px; border-radius: 50%;">
                                                {else/}
                                                    <span class="text-muted">未设置</span>
                                                {/if}
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </div>

                        <!-- 支付信息 -->
                        <div class="col-md-6">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h4 class="panel-title">支付信息</h4>
                                </div>
                                <div class="panel-body">
                                    <table class="table table-bordered">
                                        <tr>
                                            <td><strong>第三方订单号</strong></td>
                                            <td>{$info.transaction_id|default='无'}</td>
                                        </tr>
                                        <tr>
                                            <td><strong>微信openid</strong></td>
                                            <td>{$info.openid|default='无'}</td>
                                        </tr>
                                        <tr>
                                            <td><strong>备注信息</strong></td>
                                            <td>{$info.remark|default='无'}</td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <!-- VIP套餐信息 -->
                        <div class="col-md-6">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h4 class="panel-title">VIP套餐信息</h4>
                                </div>
                                <div class="panel-body">
                                    <table class="table table-bordered">
                                        <tr>
                                            <td width="30%"><strong>套餐名称</strong></td>
                                            <td>{$info.package_name|default='未知套餐'}</td>
                                        </tr>
                                        <tr>
                                            <td><strong>套餐时长</strong></td>
                                            <td>{$info.duration|default='0'} {$info.duration_unit|default='天'}</td>
                                        </tr>
                                        <tr>
                                            <td><strong>生效时间</strong></td>
                                            <td>
                                                {if condition="!empty($info.start_time)"}
                                                    {$info.start_time|date='Y-m-d H:i:s'}
                                                {else/}
                                                    <span class="text-muted">未生效</span>
                                                {/if}
                                            </td>
                                        </tr>
                                        <tr>
                                            <td><strong>到期时间</strong></td>
                                            <td>
                                                {if condition="!empty($info.end_time)"}
                                                    {$info.end_time|date='Y-m-d H:i:s'}
                                                {else/}
                                                    <span class="text-muted">未设置</span>
                                                {/if}
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </div>

                        <!-- 订单信息 -->
                        <div class="col-md-6">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h4 class="panel-title">订单信息</h4>
                                </div>
                                <div class="panel-body">
                                    <table class="table table-bordered">
                                        <tr>
                                            <td width="30%"><strong>订单号</strong></td>
                                            <td>{$info.order_no|default='未生成'}</td>
                                        </tr>
                                        <tr>
                                            <td><strong>订单金额</strong></td>
                                            <td class="text-danger"><strong>¥{$info.amount|default='0.00'}</strong></td>
                                        </tr>
                                        <tr>
                                            <td><strong>订单状态</strong></td>
                                            <td>
                                                {switch name="info.status"}
                                                    {case value="0"}<span class="label label-warning">待支付</span>{/case}
                                                    {case value="1"}<span class="label label-success">已支付</span>{/case}
                                                    {case value="2"}<span class="label label-danger">已取消</span>{/case}
                                                    {case value="3"}<span class="label label-info">已退款</span>{/case}
                                                    {default/}<span class="label label-default">未知状态</span>
                                                {/switch}
                                            </td>
                                        </tr>
                                        <tr>
                                            <td><strong>创建时间</strong></td>
                                            <td>{$info.create_time|date='Y-m-d H:i:s'}</td>
                                        </tr>
                                        <tr>
                                            <td><strong>支付时间</strong></td>
                                            <td>
                                                {if condition="!empty($info.pay_time)"}
                                                    {$info.pay_time|date='Y-m-d H:i:s'}
                                                {else/}
                                                    <span class="text-muted">未支付</span>
                                                {/if}
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- 操作按钮 -->
                    <div class="row">
                        <div class="col-md-12">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h4 class="panel-title">订单操作</h4>
                                </div>
                                <div class="panel-body">
                                    <!-- {if condition="$info.status == 0"}
                                        <a href="{:url('vip/vipActivate', ['id' => $info.id])}" class="btn btn-success" onclick="return confirm('确认激活此VIP订单？')">
                                            <i class="fa fa-check"></i> 激活订单
                                        </a>
                                        <a href="{:url('vip/vipCancel', ['id' => $info.id])}" class="btn btn-warning" onclick="return confirm('确认取消此订单？')">
                                            <i class="fa fa-times"></i> 取消订单
                                        </a>
                                    {elseif condition="$info.status == 1"/}
                                        <a href="{:url('vip/vipRefund', ['id' => $info.id])}" class="btn btn-danger" onclick="return confirm('确认退款此订单？退款后用户VIP权限将被取消！')">
                                            <i class="fa fa-undo"></i> 申请退款
                                        </a>
                                    {/if} -->
                                    
                                    <a href="{:url('vip/orderlist')}" class="btn btn-default">
                                        <i class="fa fa-reply"></i> 返回列表
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 订单分成奖励 -->
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">订单分成奖励</h4>
                </div>
                <div class="panel-body">
                    <table class="table table-bordered">
                        <thead>
                            <tr>
                                <th>ID</th>
                                <th>邀请人</th>
                                <th>被邀请人</th>
                                <th>金额</th>
                                <th>类型</th>
                                <th>描述</th>
                                <th>时间</th>
                            </tr>
                        </thead>
                        <tbody>
                            {volist name="commission_list" id="item"}
                            <tr>
                                <td>{$item.id}</td>
                                <td>{$item.inviter_nickname|default='-'} <span class="text-muted">(ID: {$item.user_id})</span></td>
                                <td>{$item.invitee_nickname|default='-'} <span class="text-muted">(ID: {$item.from_user_id})</span></td>
                                <td>{$item.amount}</td>
                                <td>{$item.type}</td>
                                <td>{$item.description}</td>
                                <td>{$item.create_time|date="Y-m-d H:i:s"}</td>
                            </tr>
                            {/volist}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
